Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Connect  network  drive  

 Content of Connect network drive.vbs
MD5 Hash: 9A7286AE2415BD57C1A1BFE8634E1590

Call ConnectND("m:","\\192.168.2.4\Docs",False,"","")

' -----------------------------------------------------------------------
Private Function ConnectND(sDrive, sTarget, bPermanent, sUser, sPassword)

On Error Resume Next

Dim oWNet : Set oWNet = WScript.CreateObject("WScript.Network")

If Len(sUser) > 0 then
oWNet.MapNetworkDrive sDrive, sTarget, bPermanent, sUser, sPassword
Else
oWNet.MapNetworkDrive sDrive, sTarget, bPermanent
End if

If Err.Number <> 0 then
msgbox "Error: " & Err.Number & VbCrLf & Err.Description
Else
msgbox "Connect network drive " & sDrive & VbCrLf & "Status = OK"
End if

End Function

   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a